import request from '@/utils/request_1'

// 新增盘点清单
export const addCheckList = (params: any) =>
  request({
    url: '/checkList',
    method: 'post',
    data: { ...params }
  })

// 修改盘点清单
export const updateCheckList = (params: any) =>
  request({
    url: '/checkList',
    method: 'put',
    data: { ...params }
  })

// 删除盘点清单
export const deleteCheckList = (params: any) =>
  request({
    url: '/checkList',
    method: 'delete',
    params
  })
// 批量新增盘点清单
export const batchAllCheckList = (params: any) =>
  request({
    url: '/checkList/batch',
    method: 'post',
    data: { ...params }
  })
// 查询全部盘点清单
export const findAllCheckList = (params: any) =>
  request({
    url: '/checkList/list',
    method: 'get',
    params
  })
// 分页查询盘点清单
export const findCheckListPaging = (params: any) =>
  request({
    url: '/checkList/page',
    method: 'get',
    params
  })
// 分页查询盘点清单明细
export const findCheckListDetailsPaging = (params: any) =>
  request({
    url: '/checkList/pageDetail',
    method: 'get',
    params
  })
// 查询盘点清单
export const findCheckList = (params: any) =>
  request({
    url: `/checkList/${params}`,
    method: 'get'
  })
// 查询盘点清单关联的库位id集合
export const findSelectedCheckList = (params: any) =>
  request({
    url: '/checkList/stockIds',
    method: 'get',
    params
  })

// 删除盘点清单-- 根据masterId
export const deleteCheckListByMasterId = (params: any) =>
  request({
    url: '/checkList/masterId',
    method: 'delete',
    params
  })
